package com.starryx.blog.dao;

import com.starryx.blog.po.Comment;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;


import java.util.List;

@Repository
public interface CommentMapper {
    Comment findOneById(@Param("id") Long id);

    List<Comment> findAllByBlogId(@Param("blog_id") Long id);

    List<Comment> findAllByParentCommentId(@Param("parent_comment_id") Long id);

    List<Comment> findByBlogIdAndParentCommentNull(@Param("blog_id") Long id);

    int save(Comment comment);


}
